package com.dwr;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.spring.service.news.ArticlesLeibieService;
import javax.servlet.http.HttpServletRequest;


import uk.ltd.getahead.dwr.WebContextFactory;

public class DwrClass
{
	private ArticlesLeibieService articlesLeibieService = null;
	public String findNewsLeibie(String showid, Long id,int temp)
	{
		temp++;
		HttpServletRequest request = WebContextFactory.get().getHttpServletRequest(); 
		List article_leibie;
		String wstr="";
		String hql="from ArticlesLeibie where fatherId="+id;
		article_leibie=articlesLeibieService.findNewsLeibie(hql);
		if (article_leibie != null) {
            request.setAttribute("leibieList", article_leibie);
            request.setAttribute("showid", "selectName"+temp);
            System.out.println("selectName"+temp);
            request.setAttribute("jsFunction", "showLeibeiList");
            request.setAttribute("temp", temp);
            try
            {
            	wstr = WebContextFactory.get().forwardToString("/ajax/selectLeibie.jsp");
            }
            catch(Exception e)
            {
            	e.printStackTrace();
            }
        }
		return wstr;
	}
	
	public ArticlesLeibieService getArticlesLeibieService() {
		return articlesLeibieService;
	}

	public void setArticlesLeibieService(ArticlesLeibieService articlesLeibieService) {
		this.articlesLeibieService = articlesLeibieService;
	}
}
